package com.ruoyi.wetest.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wetest.mapper.WetestProjectsMapper;
import com.ruoyi.wetest.domain.WetestProjects;
import com.ruoyi.wetest.service.IWetestProjectsService;

/**
 * 压测项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-30
 */
@Service
public class WetestProjectsServiceImpl implements IWetestProjectsService 
{
    @Autowired
    private WetestProjectsMapper wetestProjectsMapper;

    /**
     * 查询压测项目
     * 
     * @param projectId 压测项目主键
     * @return 压测项目
     */
    @Override
    public WetestProjects selectWetestProjectsByProjectId(String projectId)
    {
        return wetestProjectsMapper.selectWetestProjectsByProjectId(projectId);
    }

    /**
     * 查询压测项目列表
     * 
     * @param wetestProjects 压测项目
     * @return 压测项目
     */
    @Override
    public List<WetestProjects> selectWetestProjectsList(WetestProjects wetestProjects)
    {
        return wetestProjectsMapper.selectWetestProjectsList(wetestProjects);
    }

    /**
     * 新增压测项目
     * 
     * @param wetestProjects 压测项目
     * @return 结果
     */
    @Override
    public int insertWetestProjects(WetestProjects wetestProjects)
    {
        wetestProjects.setCreateTime(DateUtils.getNowDate());
        return wetestProjectsMapper.insertWetestProjects(wetestProjects);
    }

    /**
     * 修改压测项目
     * 
     * @param wetestProjects 压测项目
     * @return 结果
     */
    @Override
    public int updateWetestProjects(WetestProjects wetestProjects)
    {
        wetestProjects.setUpdateTime(DateUtils.getNowDate());
        return wetestProjectsMapper.updateWetestProjects(wetestProjects);
    }

    /**
     * 批量删除压测项目
     * 
     * @param projectIds 需要删除的压测项目主键
     * @return 结果
     */
    @Override
    public int deleteWetestProjectsByProjectIds(String[] projectIds)
    {
        return wetestProjectsMapper.deleteWetestProjectsByProjectIds(projectIds);
    }

    /**
     * 删除压测项目信息
     * 
     * @param projectId 压测项目主键
     * @return 结果
     */
    @Override
    public int deleteWetestProjectsByProjectId(String projectId)
    {
        return wetestProjectsMapper.deleteWetestProjectsByProjectId(projectId);
    }
}
